import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../layout/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index,
    children: [
      {
        path: '/',
        component: () =>
          import(/* webpackChunkName: "search" */ '../views/Search.vue')
      },
      {
        path: '/list',
        component: () =>
          import(/* webpackChunkName: "list" */ '../views/List.vue')
      },
      {
        path: '/detail',
        component: () =>
          import(/* webpackChunkName: "detail" */ '../views/Detail.vue')
      }
    ]
  }
]

// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')

const router = new VueRouter({
  routes
})

export default router
